from presenter import basepresenter

class MainPresenter(basepresenter.BasePresenter):
    
    def respondToGet(self):
        #get the articles
        articles = self.articletask.getNewest(self.settings.mainpagearticlecount)
        self.template_values['articles'] = articles

        #get the main feature
        if (self.settings.showmainfeature):
            mainfeatures = self.articletask.getMainFeature()
            self.template_values['mainfeatures'] = mainfeatures

        # set up the page title
        page_title = self.sitetitle + ' - Home'
        self.template_values['page_title'] = page_title

        #get the view to draw the page
        self.view.showGetResponse(self.template_values)